
function h = plot_map(lon,lat,var)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THIS FUNCTION PRODUCES A MAP OF THE SELECTED VARIABLE IN THE DERWENT
% ESTUARY.
% NOTE MTHAT THIS FUNCTION CALLS SUBFUNCTIONS THAT ARE PART OF M_MAP A 
% FREE MAPPING PACKAGE FOR MATLAB;  HTTP://WWW.EOS.UBC.CA/~RICH/MAP.HTML
%  
% INPUT  : - lon     : SETAS longitude matrix
%          - lat     : SETAS latitude matrix
%          - var     : a SETAS variable. Available options are 'temp' or 
%                     'salt' 
% OUTPUT : - h       : figure handle
%        
%
% Author: Benedicte Pasquer, IMOS/eMII (http://imos.org.au/)
% email: benedicte.pasquer@utas.edu.au
% May 2013   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


h = figure('Position',[100 100 900 1500],'Color',[1 1 1]);
% DEFINE THE PROJECTION 
m_proj('mercator','long',[147.00 147.5],'lat',[-43.07 -42.7])
% CREATE THE SURFACE PLOT
m_pcolor(lon,lat,var);shading flat
hold on
% ADD THE GRID INFORMATION
m_grid('xtick',[147 147.16667 147.3333 147.5],...
    'ytick',[-43 -42.8333 -42.9166 -42.75], 'linewi',1,'linest',':',...
    'tickdir','out','fontsize',12);
% ADD USER DEFINED USERCOAST
m_usercoast('Derwent.mat','patch',([1 1 1]));


